package cn.ljy.uem.model;

import cn.ljy.authority.model.SysUser;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 学生类
 *
 * @author 小锋
 * @date 2022/07/18
 */
@ApiModel(value="学生")
@Data
@NoArgsConstructor
public class SchoolStudent implements java.io.Serializable{

    // 在mapper关联部门属性
    private Long id;

    @ApiModelProperty(value="学生所属行政班")
    private Integer classId;

    @ApiModelProperty(value="学生对应账户")
    private Long userId;

    @ApiModelProperty(value="学号")
    @Length(min = 4, max = 20, message = "学号的长度必须在 {min} - {max} 之间")
    private String studentNumber;

    @NotNull(message = "性别不能为空")
    @Range(min = 0,max = 2,message = "性别的数值必须在{min} - {max}之间")
    private Integer sex;//性别

    private Date birth;                         //出生日期
    private String nativePlace;                 //籍贯
    private  String address;                    //地址
    @Length(min = 3, max = 15, message = "电话的长度必须在 {min} - {max} 之间")
    private String tel;                         //电话
    private  String identityCard;               //身份证
    private String photo;                       //个人照片
    private String national;                    //民族
    private String hobby;                       //兴趣爱好
    private String skill;                       //技能特长
    private String intro;                       //个人简介
    @NotBlank(message = "名称不能为空")
    @Length(min = 2, max = 30, message = "名称长度必须在 {min} - {max} 之间")
    private String name;                        //学生姓名
    private String description;                 //账户描述
    private Date createTime;
    private Date updateTime;


    // 非数据库字段
    private SchoolClass schoolClass;            //所属班级信息

    private SysUser sysUser;                    //学生账号信息

    private SchoolMajor schoolMajor;            //所属专业信息

    private SchoolGrade schoolGrade;            //所属年级信息

    private SchoolDepartment schoolDepartment;  //所属部门信息


    public interface StudentSex {               //用户性别
        int secrecy=0;    // 保密
        int MAN = 1;      //男
        int WOMAN = 2;    //女
    }
}
